*****Generate dimensions from factor scores****

gen exp_liberal = (exp1 + exp3 + exp4 + exp5 + exp6)/5
gen exp_social = (exp13 + exp15)/2
gen exp_direct = exp8
gen ev_liberal = (ev1 + ev3 + ev4 + ev5 + ev6)/5
gen ev_social = (ev13 + ev15)/2
gen ev_direct = ev8

label var  exp_liberal "Expectations “liberal”"
label var  exp_social "Expectations “social”"
label var  exp_direct "Expectations “direct”"

label var  ev_liberal "Evaluations “liberal”"
label var  ev_social "Evaluations “social”"
label var  ev_direct "Evaluations “direct”"


***Generate distance-measure***

gen distance_liberal = (sqrt(2)/2)*(ev_liberal - exp_liberal) 
gen distance_social = (sqrt(2)/2)*(ev_social - exp_social) 
gen distance_direct = (sqrt(2)/2)*(ev_direct - exp_direct)

label var distance_liberal "Distance “liberal”"
label var distance_social "Distance “social”"
label var distance_direct "Distance “direct”"

gen crisis_country = 0
replace crisis_country = 1 if (country == "Cyprus" | country == "Spain" | country == "Ireland" | country == "Italy" | country == "Portugal")
label var crisis_country "Eurocrisis country"
